package org.blog.exception;

public class BaseException extends RuntimeException{
    //错误信息码
    private String code;

    //错误提示信息
    private String message;

    public BaseException() {
        super();
    }

    /**
     * 自定义构造方法
     * @param baseErrorEnum
     */
    public BaseException(BaseErrorEnum baseErrorEnum) {
        super(baseErrorEnum.getCode());
        this.code = baseErrorEnum.getCode();
        this.message = baseErrorEnum.getMessage();
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
